import akshare as ak
from texttable import Texttable as TB
import sqlite3

df = ak.stock_xgsglb_em()
print()
tb = TB(max_width=1000)
tb.header(df.columns.values)
tb.add_rows(df.values, header=False)
print(tb.draw())
conn = sqlite3.connect('test.db')
cur = conn.cursor()
# 建表的sql语句
sql_text_1 = '''CREATE TABLE scores
           (姓名 TEXT,
            班级 TEXT,
            性别 TEXT,
            语文 NUMBER,
            数学 NUMBER,
            英语 NUMBER);'''
# 执行sql语句
cur.execute(sql_text_1)
# 关闭游标
cur.close()
# 关闭连接
conn.close()